//------------------------------------------------------------------------------
// <copyright company="Telligent Systems">
//     Copyright (c) Telligent Systems Corporation.  All rights reserved.
// </copyright> 
//------------------------------------------------------------------------------

using System;
using System.Collections;
using System.Web.UI.WebControls;
using CommunityServer.Components;

namespace CommunityServer.Controls
{
	public class TemplateDropDownList : DropDownList
	{
		private TemplateType templateType;

		public TemplateDropDownList()
		{
		}

		protected override void OnInit(EventArgs e)
		{
			ArrayList templates = ResourceManager.GetTemplates(TemplateType);

			foreach (Template template in templates)
			{
				Items.Add(new ListItem(template.Title, template.TemplateID.ToString()));
			}

			base.OnInit (e);
		}


		public TemplateType TemplateType
		{
			get { return templateType; }
			set { templateType = value; }
		}
	}
}
